Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change parameter double types to num #78

Merged
merged 1 commit into from
Sep 28, 2023
Merged

Conversation

srujzs
Copy link
Contributor

@srujzs srujzs commented Sep 25, 2023

Closes #57

Makes it easier to migrate off of dart:html APIs and allows users to pass integers without having to convert to doubles.

@srujzs
Copy link
Contributor Author

srujzs commented Sep 25, 2023

We could go further and replace all doubles with num for consistency (and we wouldn't have to worry about typedefs), but that's a breaking change. Thoughts?

@sigmundch
Copy link
Member

I was tempted to make it symmetrical, but I worry that this makes getters and return values harder to use. If we make them all num, users will need to cast them or convert them to the underlying type (via .toDouble/.toInt) when they read values from the DOM.

We can test it out on my fork of pop-pop-win to get additional validation, if you like.

@srujzs
Copy link
Contributor Author

srujzs commented Sep 27, 2023

Chatted offline, but summarizing: it's quite rare for dart:html to return a double, while it's much more common for it to use nums. As such, it's fine to use num for consistency and not have to worry about typedefs.

Closes dart-lang#57

Makes it easier to migrate off of dart:html APIs and allows users
to pass integers without having to convert to doubles.
@srujzs srujzs merged commit 0856987 into dart-lang:main Sep 28, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider using num instead of double for parameter types
2 participants